package com.xigua.JucOfBeautiful.chapterSix._6_1;

import com.sun.org.apache.bcel.internal.generic.NEW;

import java.util.concurrent.locks.LockSupport;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/2/222:08
 */
public class UnparkTest {

    public void testPark(){
        LockSupport.park(this);
    }

    public static void main(String[] args) throws InterruptedException {
//        Thread thread = new Thread(()->{
//            System.out.println("child thread begin park");
//            while (!Thread.currentThread().isInterrupted()){
//                LockSupport.park();
//            }
//            System.out.println("child thread nnpark");
//        });
//        thread.start();
//        Thread.sleep(1000);
//        System.out.println("main thread begin unpark");
//
//        thread.interrupt();

        UnparkTest unparkTest = new UnparkTest();
        unparkTest.testPark();

    }
}
